﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace Restaurant.Reservations.Converters
{
  public class BoolToBrushConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      if (null == value)
        return Brushes.White;
      var delayed = false;
      Boolean.TryParse(value.ToString(), out delayed);
      if (delayed)
        return Brushes.Red;

      return Brushes.White;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      return Brushes.White;
    }
  }
}